home *** CD-ROM | disk | FTP | other *** search
- /* Automatic brush drop shadow creator for OpalPaint.
- AREXX script by Greg Nies, Centaur Development.
- */
-
- address 'OpalPaint_Rexx'
-
- options Results
-
- SaveSetUp
- Panic
-
- AskBool "Drop Shadow Maker v1.0 - by Greg Niles\nClick OK to continue, Cancel to Abort."
- If Result = 0 then EXIT
-
- /* Ask which brush to use */
- AskInt 1 3 1 "Select brush number (1-3).\n(Select CANCEL if you don't want to lose your brush!)"
- If RC = 5 then EXIT
- BrushBay = Result
-
- /* Get size of selected brush */
- ActiveBrush BrushBay
- BrushSize
- parse var result BWidth BHeight
-
- /* Get feather amount from user */
- AskInt 0 640 0 "Enter feather amount (0=no feathering).\nThis determines the 'fuzziness' of your drop shadow, in pixels."
- If RC = 5 then EXIT
- FeatherAmt = Result
-
- /* Get transparency level from user */
- AskProp 0 100 50 "Select transparency level of drop shadow."
- If RC = 5 then EXIT
- TransAmt = Result
-
- /* Make a new screen */
- CurrPage
- OrigPage = Result
- PageRes
- AddPage 640 400 Result
- OpenPages
- NewPage = Result
- PickPage NewPage
-
- /* Place brush in center of new screen & in alpha channel */
- PageSize
- parse var result PageWidth PageHeight
- XPosition = Trunc((PageWidth/2)-(BWidth/2))
- YPosition = Trunc((PageHeight/2)-(BHeight/2))
- ActiveBrush BrushBay
- Handle 0 0
- ColorSource Multicolor
- PutBrush XPosition YPosition
- WorkMode ALPHA
- SetDrawMode 4
- Zap
- SetDrawMode 1
- ActiveBrush BrushBay
- Handle 0 0
- ColorSource PaintPot
- ActivePot 1
- PutBrush XPosition YPosition
- WorkMode Image
-
- /* Feather the brush */
- ActiveBrush BrushBay
- Feather FeatherAmt
-
- /* Ask for position of drop shadow */
- Okay "Choose the location of your drop shadow."
- GetPoint
- parse var result XDropPos YDropPos
-
- /* Let's do it! */
- Busy
- WorkMode Alpha /* Paste drop shadow into alpha channel */
- Panic
- SetDrawMode 1
- ActiveBrush BrushBay
- Handle 0 0
- ColorSource PaintPot
- TransType Standard TransAmt
- Trans Enable
- ActivePot 1
- PutBrush XDropPos YDropPos
- Trans Disable
-
- /* Calculate size of area to contain brush & drop shadow */
- X1 = MIN(XPosition,XDropPos)
- Y1 = MIN(YPosition,YDropPos)
- X2 = MAX(XPosition+BWidth,XDropPos+BWidth)
- Y2 = MAX(YPosition+BHeight,YDropPos+BHeight)
-
- /* Cut brush with alpha drop shadow */
- WorkMode Image
- ActiveBrush BrushBay
- CutMode Normal 1
- RectCut X1 Y1 X2 Y2
-
- /* Go back to old page */
- PickPage OrigPage
-
- Okay "We're done! Paste your new brush anywhere you want!"
-
- RestoreSetUp
- NotBusy
- EXIT
-